<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.Date" %>
<%@ page import="ut.data.User" %>
<%@ page import="ut.res.Language" %>
<%
	User user = (User)session.getAttribute("user");
	if(user == null){
		response.sendRedirect("/");
		return;
	}
	if(user.verify == 0){
		response.sendRedirect("/");
		return;
	}
%>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>UT終極一翻！ | 建立付費案件</title>
	<link rel="stylesheet" type="text/css" href="/style.css" media="all" />
	<link rel="stylesheet" type="text/css" href="/css/task-create.css" media="all" />
	<script type="text/javascript" src="/js/Utility.js"></script>
	<script type="text/javascript" src="/js/Message.js"></script>
	<script type="text/javascript" src="/js/Ajax.js"></script>
	<script type="text/javascript" src="/js/Button.js"></script>
	<script type="text/javascript" src="/js/Account.js"></script>
	<script type="text/javascript" src="/js/Task.js"></script>
	<script type="text/javascript" src="/js/MyDate.js"></script>
	<script type="text/javascript" src="/script.js"></script>
</head>
<body onload="init();Task.TaskCreate.setDateSelecter('create-form');">
<%@ include file="/include/banner.jsp" %>
	<div class="content">
		<div class="title">建立付費案件</div>
		<form id="create-form" class="create-form block" onsubmit="Task.TaskCreate.create(this);return false;">
			<div class="create-content">
				<div class="create-element">
					<div class="create-element-left">案主：</div>
					<div class="create-element-right"><%= user.name %></div>
				</div>
				<div class="create-element">
					<div class="create-element-left">翻譯語言：</div>
					<div class="create-element-right">
						<div id="task-create-spec-selector" class="create-element">
							從
							<select name="fromLang" id="from-lang">
<%
	Language[] langs = Language.getLanguages();
	for(int i = 0; i < langs.length; i++){
		out.println("<option value='" + langs[i].id + "'>" + langs[i].title + "</option>");
	}
%>
							</select>
							翻譯至
							<select name="toLang">
<%
	for(int i = 0; i < langs.length; i++){
		out.println("<option value='" + langs[i].id + "'>" + langs[i].title + "</option>");
	}
%>
							</select>
						</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">帳戶餘額：</div>
					<div class="create-element-right">
						NTD <%= user.money %> 元 【<a target="_top" href="/account/deposit.jsp">儲值</a>】
						<input type="hidden" name="money" value="<%= user.money %>" />
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						案件價格：
						<div class="mark-red comment">＊最低 NTD 100 元</div>
						<div class="mark-red comment">＊最高 NTD 25000 元</div>
					</div>
					<div class="create-element-right">
						NTD <input name="price" style="width:100px" /> 元
						<div class="mark-gray comment">例：NTD 2000 元。</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">案件建立日期：</div>
					<div class="create-element-right">
						<span id="year-now"></span> 年
						<span id="month-now"></span> 月
						<span id="date-now"></span> 日
						<input type="hidden" name="now" value="" />
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						案件截止日期：
						<div class="mark-red comment">＊期限至多 180 天</div>
					</div>
					<div class="create-element-right">
						<select name="year" onchange="Task.TaskCreate.setDateSelecter('create-form', this);">
							<option value="">請選擇</option>
						</select>年
						<select name="month" onchange="Task.TaskCreate.setDateSelecter('create-form', this);">
							<option value="">請選擇</option>
						</select>月
						<select name="date">
							<option value="">請選擇</option>
						</select>日
						23 時 59 分 59 秒
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						翻譯案件領域：
						<div class="mark-red comment">＊限 30 字元</div>
					</div>
					<div class="create-element-right">
						<input name="domain" style="width:100%" />
						<div class="mark-gray comment">例：自傳、履歷、新聞、會議紀錄、法律、商業、科學......。</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						翻譯案件描述：
						<div class="mark-red comment">＊限 300 字元</div>
					</div>
					<div class="create-element-right">
						<textarea name="description"></textarea>
						<div class="mark-gray comment">例：案件內容為專業化學論文，包含許多專有名詞。請參考部分內容：......。</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">
						翻譯原文：
						<div class="mark-red comment">＊限 50000 字元</div>
					</div>
					<div class="create-element-right">
						<textarea name="content" style="height:500px" 
							onkeyup="Task.TaskCreate.countLetter(this);Task.TaskCreate.countWord(this);"></textarea>
						<div class="mark-red">
							已輸入字數：<span id="word-count">0</span>，字元數：<span id="letter-count">0</span>。
						</div>
						<div class="mark-gray comment">請選擇正確的原文語言，計算時才會符合實際情況。</div>
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left">注意事項：</div>
					<div class="create-element-right">
						1. 付費案件的翻譯原文和譯文只有案主和接案譯者能閱讀。<br/>
						2. 您提供的翻譯原文內容沒有侵害任何第三方的著作權。<br/>
						3. 您已完全了解本站的【<a target="_blank" href="/image/task-flow.png">付費案件詳細流程</a>】說明。<br/><br/>
						<input type="checkbox" name="agree" />我已閱讀並同意上述注意事項。
					</div>
				</div>
				<div class="create-element">
					<div class="create-element-left create-element-button">
						<input name="submit" type="submit" class="button" value="建立"
							onmousedown="this.style.borderStyle='inset';"
							onmouseup="this.style.borderStyle='outset';"
							onmouseout="this.style.borderStyle='outset';" />
					</div>
					<div class="create-element-right create-element-button">
						<button type="button" class="button"
							onmousedown="this.style.borderStyle='inset';"
							onmouseup="this.style.borderStyle='outset';"
							onmouseout="this.style.borderStyle='outset';"
							onclick="document.location.href='/task-create-select.jsp'">
							取消
						</button>
					</div>
				</div>
				<div style="clear:both"></div>
			</div>
		</form>
<%@ include file="/include/foot.jsp" %>
	</div>
</body>
</html>